package com.dm.service;

import com.dm.dao.DmBaseKeywordSortMapper;
import com.dm.pojo.DmBaseKeywordSort;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * Created by dm
 */
@RestController
public class RestDmBaseKeywordSortService {

     @Autowired
     private DmBaseKeywordSortMapper dmBaseKeywordSortMapper;

     @RequestMapping(value = "/getDmBaseKeywordSortById",method = RequestMethod.POST)
     public DmBaseKeywordSort getDmBaseKeywordSortById(@RequestParam("id") Long id)throws Exception{
        return dmBaseKeywordSortMapper.getDmBaseKeywordSortById(id);
     }

     @RequestMapping(value = "/getDmBaseKeywordSortListByMap",method = RequestMethod.POST)
     public List<DmBaseKeywordSort>	getDmBaseKeywordSortListByMap(@RequestParam Map<String,Object> param)throws Exception{
        return dmBaseKeywordSortMapper.getDmBaseKeywordSortListByMap(param);
     }

     @RequestMapping(value = "/getDmBaseKeywordSortCountByMap",method = RequestMethod.POST)
     public Integer getDmBaseKeywordSortCountByMap(@RequestParam Map<String,Object> param)throws Exception{
        return dmBaseKeywordSortMapper.getDmBaseKeywordSortCountByMap(param);
     }

     @RequestMapping(value = "/qdtxAddDmBaseKeywordSort",method = RequestMethod.POST)
     public Integer qdtxAddDmBaseKeywordSort(@RequestBody DmBaseKeywordSort dmBaseKeywordSort)throws Exception{
        dmBaseKeywordSort.setCreatedTime(new Date());
        return dmBaseKeywordSortMapper.insertDmBaseKeywordSort(dmBaseKeywordSort);
     }

     @RequestMapping(value = "/qdtxModifyDmBaseKeywordSort",method = RequestMethod.POST)
     public Integer qdtxModifyDmBaseKeywordSort(@RequestBody DmBaseKeywordSort dmBaseKeywordSort)throws Exception{
        dmBaseKeywordSort.setUpdatedTime(new Date());
        return dmBaseKeywordSortMapper.updateDmBaseKeywordSort(dmBaseKeywordSort);
     }
}
